/**
 * Created with IntelliJ IDEA.
 * Description:
 * User:
 * Date: 2024-08-29
 * Time: 16:07
 */
public class Test {
    public static void main(String[] args) {
        BinaryTree binaryTree = new BinaryTree();
        BinaryTree.TreeNode root = binaryTree.createTree();

        binaryTree.preOrder(root);
        System.out.println();
        binaryTree.inOrder(root);
        System.out.println();
        binaryTree.postOrder(root);
        System.out.println();

        //binaryTree.size2(root);
        binaryTree.getLeafNodeCount1(root);
        System.out.println("节点个数：" + binaryTree.size2(root));

        System.out.println("叶子节点个数：" + binaryTree.getLeafNodeCount1(root));
        System.out.println("第二行节点个数：" + binaryTree.getKLevelNodeCount(root,2));
        System.out.println("树高为：" + binaryTree.getHeight(root));
        BinaryTree.TreeNode ret =  binaryTree.findVal(root, 'B');
        System.out.println(ret.val);
    }
}
